package cn.zwx.business.order.config;

import cn.zwx.business.order.constants.CommonConstant;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @description: 商品服务属性值
 * @projectName:rocket-mq-example
 * @see:cn.zwx.business.order.config
 * @author:zhangwenxue
 * @createTime:2020/10/15 12:39
 * @version:1.0
 */
@Configuration
@Component
public class OrderProperties {


    @Value("${rocketmq.namesrvaddr}")
    private String nameServer;


    @Value("${spring.application.name}")
    private String applicationName;

    @Bean
    @PostConstruct
    public int init(){
        //赋值
        CommonConstant.NAME_SERVER=this.nameServer;
        CommonConstant.APPLICATION_NAME=this.applicationName;
        return 0;
    }

}
